package com.wcarmon.life.business {

    import com.adobe.cairngorm.business.ServiceLocator;
    import com.adobe.cairngorm.business.IServiceLocator;
    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;

    import com.wcarmon.life.vo.BlockVO;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.IResponder;
	import flash.utils.*;

	public class CreateBlockDelegate {
		include "../../includes/loggerSnippet.as";

		private var responder : IResponder;
		private var service : Object;

		public function CreateBlockDelegate( responder : IResponder ){
			this.service = ServiceLocator.getInstance().getRemoteObject("LifeCollectService");
			this.responder = responder;
			log.info( 'Using this php file: ' + this.service.source );
		}
		public function createBlock( block : BlockVO ) : void {
			log.info("Creating a new block");
			log.debug( "Block to create: " + ObjectUtil.toString(block) );
			var call : Object = service.createBlock( block );
			call.addResponder( responder );
		}
	}
}